how to check if local storage variable exists in javascript

83

how to check if local storage variable exists in javascript -

if (localStorage.getItem("username") === null) {
  //...
}

Comments

Submit
0 Comments